{{!
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements.  See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership.  The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License.  You may obtain a copy of the License at
*
*     http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
}}

<div class="row">
  <div class="col-md-12 form-horizontal table-name-input">
    <div class="form-group {{if hasTableNameError 'has-error'}}">
      <label class="col-md-1 control-label">Name</label>
      <div class="col-md-11">
        {{input type="text" class="form-control" placeholder="Table name" value=tableName}}
        {{#if hasTableNameError}}
          <span class="help-block">Name cannot be empty</span>
        {{/if}}
      </div>
    </div>
  </div>
</div>

{{#tabs-pane tabs=tabs inverse=true as |tab|}}
  {{tabs-item tab=tab tabs=tabs activate="activate"}}
{{/tabs-pane}}

<div class="create-table-inner">
  <div class="row">
    {{#each tabs as |tab|}}
      {{#if tab.active}}
        {{#if (eq tab.link "create.table.columns")}}
          {{#if hasTableConfigurationError}}
            <div class="alert alert-danger create-table-error">
              {{tableConfigurationErrorText}}
            </div>
          {{/if}}
          {{table-columns columns=columns shouldAddBuckets=shouldAddBuckets options=options}}
        {{/if}}
        {{#if (eq tab.link "create.table.properties")}}
          {{table-properties properties=properties}}
        {{/if}}
        {{#if (eq tab.link "create.table.advanced")}}
          {{table-advanced-settings settings=settings shouldAddBuckets=shouldAddBuckets errors=settingErrors}}
        {{/if}}
      {{/if}}
    {{/each}}
  </div>

</div>
<div class="create-table-controls">
  <button class="btn btn-success" {{action "create"}}>{{fa-icon "plus"}} Create</button>
  <button class="btn btn-warning" {{action "cancel"}}>{{fa-icon "times"}} Cancel</button>
</div>
